Skip to content

Comments

Sales Validation Agent - Implementation of the sample agent via the AL SDK#345

Merged
qutreson merged 7 commits intomicrosoft:masterfrom
BazookaMusic:feature/sva
Feb 23, 2026
Merged

Sales Validation Agent - Implementation of the sample agent via the AL SDK#345
qutreson merged 7 commits intomicrosoft:masterfrom
BazookaMusic:feature/sva

Conversation

@BazookaMusic
Copy link

This PR adds the "Sales Validation Agent" which is packaged as a sample app when designing agents in Business Central. It demonstrates how the agent can be packaged into an app and the different components that this app contains.


AgentTaskBuilder.Initialize(AgentUserSecurityId, TaskTitle);
ExternalId := Format(CreateGuid());
AgentTaskBuilder.SetExternalId(ExternalId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using this syntax?

AgentTaskBuilder.Initialize(AgentUserSecurityId, TaskTitle)
        .SetExternalId(ExternalId)
        .AddTaskMessage(From, Message)
        .Create();

var
UserSecurityIDFilter: Text;
begin
if IsNullGuid(Rec."User Security ID") then begin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have a comment explaining how that page behaves and is launched.
There's a convention that the source record must have a User Security ID Guid field and that the record is not fully populated. A comment would explain your code.

{
Caption = 'User Security ID';
ToolTip = 'Specifies the unique identifier for the user.';
DataClassification = EndUserPseudonymousIdentifiers;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, it's part of the interface contract, we could have a comment explaining why we have it that way

SotirisDragonas and others added 5 commits February 23, 2026 10:34
- Add MIT copyright headers to all .al files
- Fix using statement ordering (alphabetical) across all files
- Use fluent AgentTaskBuilder chaining syntax
- Fix IF -> if casing
- Remove SingleInstance from KPI logging codeunit (no global state)
- Use IsEmpty() instead of not FindFirst() in factory
- Clarify ShowCanCreateAgent is UI-only, not a hard single-instance guard
- Enable agent profile (Enabled = true)
- Remove redundant 'internal' keyword from Setup codeunit methods
- Add comments explaining KPI page/table and Setup table interface contract
- Rename app to 'Sales Validation Agent Sample' in app.json
- Fix README: single-instance claim, Preview auto-enabled, avatar/role center mention

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@qutreson qutreson merged commit e4d3762 into microsoft:master Feb 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants